|
| static void | handleInterruptEvent () |
| |
| static INLINE void | setInterruptEvent (uint8_t evt, bool highPriority) |
| |
| static void | reportPrinterMode () |
| |
| static INLINE void | setMenuMode (uint16_t mode, bool on) |
| |
| static INLINE bool | isMenuMode (uint8_t mode) |
| |
| static void | setDebugLevel (uint8_t newLevel) |
| |
| static void | toggleEcho () |
| |
| static void | toggleInfo () |
| |
| static void | toggleErrors () |
| |
| static void | toggleDryRun () |
| |
| static void | toggleCommunication () |
| |
| static void | toggleNoMoves () |
| |
| static void | toggleEndStop () |
| |
| static INLINE uint8_t | getDebugLevel () |
| |
| static INLINE bool | debugEcho () |
| |
| static INLINE bool | debugInfo () |
| |
| static INLINE bool | debugErrors () |
| |
| static INLINE bool | debugDryrun () |
| |
| static INLINE bool | debugCommunication () |
| |
| static INLINE bool | debugNoMoves () |
| |
| static INLINE bool | debugEndStop () |
| |
| static INLINE bool | debugFlag (uint8_t flags) |
| |
| static INLINE void | debugSet (uint8_t flags) |
| |
| static INLINE void | debugReset (uint8_t flags) |
| |
| static void | setFanSpeedDirectly (uint8_t speed) |
| |
| static void | setFan2SpeedDirectly (uint8_t speed) |
| |
| static INLINE void | disableXStepper () |
| | Disable stepper motor for x direction. More...
|
| |
| static INLINE void | disableYStepper () |
| | Disable stepper motor for y direction. More...
|
| |
| static INLINE void | disableZStepper () |
| | Disable stepper motor for z direction. More...
|
| |
| static INLINE void | enableXStepper () |
| | Enable stepper motor for x direction. More...
|
| |
| static INLINE void | enableYStepper () |
| | Enable stepper motor for y direction. More...
|
| |
| static INLINE void | enableZStepper () |
| | Enable stepper motor for z direction. More...
|
| |
| static INLINE void | setXDirection (bool positive) |
| |
| static INLINE void | setYDirection (bool positive) |
| |
| static INLINE void | setZDirection (bool positive) |
| |
| static INLINE bool | getZDirection () |
| |
| static INLINE bool | getYDirection () |
| |
| static INLINE bool | getXDirection () |
| |
| static INLINE uint8_t | isLargeMachine () |
| |
| static INLINE void | setLargeMachine (uint8_t b) |
| |
| static INLINE uint8_t | isAdvanceActivated () |
| |
| static INLINE void | setAdvanceActivated (uint8_t b) |
| |
| static INLINE uint8_t | isHomedAll () |
| |
| static INLINE void | unsetHomedAll () |
| |
| static INLINE void | updateHomedAll () |
| |
| static INLINE uint8_t | isXHomed () |
| |
| static INLINE void | setXHomed (uint8_t b) |
| |
| static INLINE uint8_t | isYHomed () |
| |
| static INLINE void | setYHomed (uint8_t b) |
| |
| static INLINE uint8_t | isZHomed () |
| |
| static INLINE void | setZHomed (uint8_t b) |
| |
| static INLINE uint8_t | isAutoreportTemp () |
| |
| static INLINE void | setAutoreportTemp (uint8_t b) |
| |
| static INLINE uint8_t | isAllKilled () |
| |
| static INLINE void | setAllKilled (uint8_t b) |
| |
| static INLINE uint8_t | isAutomount () |
| |
| static INLINE void | setAutomount (uint8_t b) |
| |
| static INLINE uint8_t | isAnimation () |
| |
| static INLINE void | setAnimation (uint8_t b) |
| |
| static INLINE uint8_t | isUIErrorMessage () |
| |
| static INLINE void | setUIErrorMessage (uint8_t b) |
| |
| static INLINE uint8_t | isNoDestinationCheck () |
| |
| static INLINE void | setNoDestinationCheck (uint8_t b) |
| |
| static INLINE uint8_t | isPowerOn () |
| |
| static INLINE void | setPowerOn (uint8_t b) |
| |
| static INLINE uint8_t | isColdExtrusionAllowed () |
| |
| static INLINE void | setColdExtrusionAllowed (uint8_t b) |
| |
| static INLINE uint8_t | isBlockingReceive () |
| |
| static INLINE void | setBlockingReceive (uint8_t b) |
| |
| static INLINE uint8_t | isAutoretract () |
| |
| static INLINE void | setAutoretract (uint8_t b) |
| |
| static INLINE uint8_t | isPrinting () |
| |
| static INLINE void | setPrinting (uint8_t b) |
| |
| static INLINE uint8_t | isStartStopSupported () |
| |
| static INLINE void | setSupportStartStop (uint8_t b) |
| |
| static INLINE uint8_t | isDoorOpen () |
| |
| static bool | updateDoorOpen () |
| |
| static INLINE uint8_t | isHoming () |
| |
| static INLINE void | setHoming (uint8_t b) |
| |
| static INLINE uint8_t | isAllEMotors () |
| |
| static INLINE void | setAllEMotors (uint8_t b) |
| |
| static INLINE uint8_t | isDebugJam () |
| |
| static INLINE uint8_t | isDebugJamOrDisabled () |
| |
| static INLINE void | setDebugJam (uint8_t b) |
| |
| static INLINE uint8_t | isJamcontrolDisabled () |
| |
| static INLINE void | setJamcontrolDisabled (uint8_t b) |
| |
| static INLINE void | toggleAnimation () |
| |
| static INLINE float | convertToMM (float x) |
| |
| static INLINE bool | areAllSteppersDisabled () |
| |
| static INLINE void | setAllSteppersDiabled () |
| |
| static INLINE void | unsetAllSteppersDisabled () |
| |
| static INLINE bool | isAnyTempsensorDefect () |
| |
| static INLINE void | setAnyTempsensorDefect () |
| |
| static INLINE void | unsetAnyTempsensorDefect () |
| |
| static INLINE bool | isManualMoveMode () |
| |
| static INLINE void | setManualMoveMode (bool on) |
| |
| static INLINE bool | isAutolevelActive () |
| |
| static void | setAutolevelActive (bool on) |
| | Activate or deactivate rotation correction. More...
|
| |
| static INLINE void | setZProbingActive (bool on) |
| |
| static INLINE bool | isZProbingActive () |
| |
| static INLINE void | executeXYGantrySteps () |
| |
| static INLINE void | executeXZGantrySteps () |
| |
| static INLINE void | startXStep () |
| |
| static INLINE void | startYStep () |
| |
| static INLINE void | startZStep () |
| |
| static INLINE void | endXYZSteps () |
| |
| static INLINE speed_t | updateStepsPerTimerCall (speed_t vbase) |
| |
| static INLINE void | disableAllowedStepper () |
| |
| static INLINE float | realXPosition () |
| |
| static INLINE float | realYPosition () |
| |
| static INLINE float | realZPosition () |
| |
| static INLINE void | realPosition (float &xp, float &yp, float &zp) |
| | copies currentPosition to parameter. More...
|
| |
| static INLINE void | insertStepperHighDelay () |
| |
| static void | updateDerivedParameter () |
| |
| static void | constrainDestinationCoords () |
| |
| static void | updateCurrentPosition (bool copyLastCmd=false) |
| |
| static void | updateCurrentPositionSteps () |
| |
| static uint8_t | setDestinationStepsFromGCode (GCode *com) |
| | Sets the destination coordinates to values stored in com. More...
|
| |
| static uint8_t | moveTo (float x, float y, float z, float e, float f) |
| | Move to position without considering transformations. More...
|
| |
| static uint8_t | moveToReal (float x, float y, float z, float e, float f, bool pathOptimize=true) |
| | Move to position considering transformations. More...
|
| |
| static void | kill (uint8_t only_steppers) |
| | Stop heater and stepper motors. Disable power,if possible. More...
|
| |
| static void | updateAdvanceFlags () |
| |
| static void | setup () |
| |
| static void | defaultLoopActions () |
| |
| static void | homeAxis (bool xaxis, bool yaxis, bool zaxis) |
| | Main function for all homing operations. More...
|
| |
| static void | setOrigin (float xOff, float yOff, float zOff) |
| | Home axis. More...
|
| |
| static bool | isPositionAllowed (float x, float y, float z) |
| | Tests if the target position is allowed. More...
|
| |
| static INLINE int | getFanSpeed () |
| |
| static INLINE int | getFan2Speed () |
| |
| static INLINE void | setDeltaPositions (long xaxis, long yaxis, long zaxis) |
| |
| static void | deltaMoveToTopEndstops (float feedrate) |
| |
| static float | runZMaxProbe () |
| |
| static bool | startProbing (bool runScript, bool enforceStartHeight=true) |
| | Activate z-probe. More...
|
| |
| static void | finishProbing () |
| | Deactivate z-probe. More...
|
| |
| static float | runZProbe (bool first, bool last, uint8_t repeat=Z_PROBE_REPETITIONS, bool runStartScript=true, bool enforceStartHeight=true) |
| | Measure distance to bottom at current position. More...
|
| |
| static void | measureZProbeHeight (float curHeight) |
| |
| static void | waitForZProbeStart () |
| |
| static float | bendingCorrectionAt (float x, float y) |
| |
| static void | transformToPrinter (float x, float y, float z, float &transX, float &transY, float &transZ) |
| |
| static void | transformFromPrinter (float x, float y, float z, float &transX, float &transY, float &transZ) |
| |
| static void | resetTransformationMatrix (bool silent) |
| |
| static void | buildTransformationMatrix (Plane &plane) |
| |
| static void | measureDistortion (void) |
| |
| static void | MemoryPosition () |
| |
| static void | GoToMemoryPosition (bool x, bool y, bool z, bool e, float feed) |
| |
| static void | zBabystep () |
| | Execute a open baby step. More...
|
| |
| static INLINE void | resetWizardStack () |
| |
| static INLINE void | pushWizardVar (wizardVar v) |
| |
| static INLINE wizardVar | popWizardVar () |
| |
| static void | showConfiguration () |
| |
| static void | setCaseLight (bool on) |
| |
| static void | reportCaseLightStatus () |
| |
| static void | showJSONStatus (int type) |
| |
| static void | homeXAxis () |
| |
| static void | homeYAxis () |
| |
| static void | homeZAxis () |
| | homes z axis. More...
|
| |
| static void | pausePrint () |
| |
| static void | continuePrint () |
| |
| static void | stopPrint () |
| |
| static void | prepareForProbing () |
| | Prepares printer for probing commands. More...
|
| |
|
| static volatile int | extruderStepsNeeded |
| | This many extruder steps are still needed, <0 = reverse steps needed. More...
|
| |
| static ufast8_t | maxExtruderSpeed |
| | Timer delay for end extruder speed. More...
|
| |
| static int | advanceStepsSet |
| |
| static long | advanceExecuted |
| | Executed advance steps. More...
|
| |
| static uint16_t | menuMode = 0 |
| |
| static float | axisX1StepsPerMM |
| |
| static float | axisX2StepsPerMM |
| |
| static float | axisStepsPerMM [] = {XAXIS_STEPS_PER_MM, YAXIS_STEPS_PER_MM, ZAXIS_STEPS_PER_MM, 1} |
| | Resolution of each axis in steps per mm. More...
|
| |
| static float | invAxisStepsPerMM [] |
| | 1/axisStepsPerMM for faster computation. More...
|
| |
| static float | maxFeedrate [] = {MAX_FEEDRATE_X, MAX_FEEDRATE_Y, MAX_FEEDRATE_Z} |
| | Maximum feedrate in mm/s per axis. More...
|
| |
| static float | homingFeedrate [] = {HOMING_FEEDRATE_X, HOMING_FEEDRATE_Y, HOMING_FEEDRATE_Z} |
| |
| static uint32_t | maxInterval |
| |
| static float | maxAccelerationMMPerSquareSecond [] = {MAX_ACCELERATION_UNITS_PER_SQ_SECOND_X, MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Y, MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Z} |
| | X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts. More...
|
| |
| static float | maxTravelAccelerationMMPerSquareSecond [] = {MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_X, MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Y, MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Z} |
| | X, Y, Z max acceleration in mm/s^2 for travel moves. More...
|
| |
| static unsigned long | maxPrintAccelerationStepsPerSquareSecond [] |
| |
| static unsigned long | maxTravelAccelerationStepsPerSquareSecond [] |
| |
| static uint8_t | relativeCoordinateMode = false |
| | Determines absolute (false) or relative Coordinates (true). More...
|
| |
| static uint8_t | relativeExtruderCoordinateMode = false |
| | Determines Absolute or Relative E Codes while in Absolute Coordinates mode. E is always relative in Relative Coordinates mode. More...
|
| |
| static uint8_t | unitIsInches = 0 |
| | 0 = Units are mm, 1 = units are inches. More...
|
| |
| static uint8_t | mode = DEFAULT_PRINTER_MODE |
| |
| static uint8_t | fanSpeed = 0 |
| |
| static fast8_t | stepsPerTimerCall = 1 |
| |
| static float | zBedOffset = HAL::eprGetFloat(EPR_Z_PROBE_Z_OFFSET) |
| |
| static uint8_t | flag0 = 0 |
| |
| static uint8_t | flag1 = 0 |
| |
| static uint8_t | flag2 = 0 |
| |
| static uint8_t | flag3 = 0 |
| |
| static uint32_t | interval = 30000 |
| | Last step duration in ticks. More...
|
| |
| static uint32_t | timer |
| | used for acceleration/deceleration timing More...
|
| |
| static uint32_t | stepNumber |
| | Step number in current move. More...
|
| |
| static float | coordinateOffset [Z_AXIS_ARRAY] = {0, 0, 0} |
| |
| static int32_t | currentPositionSteps [E_AXIS_ARRAY] |
| | Position in steps from origin. More...
|
| |
| static float | currentPosition [Z_AXIS_ARRAY] |
| | Position in global coordinates. More...
|
| |
| static float | lastCmdPos [Z_AXIS_ARRAY] |
| | Last coordinates (global coordinates) send by g-codes. More...
|
| |
| static int32_t | destinationSteps [E_AXIS_ARRAY] |
| | Target position in steps. More...
|
| |
| static millis_t | lastTempReport = 0 |
| |
| static float | extrudeMultiplyError = 0 |
| | Accumulated error during extrusion. More...
|
| |
| static float | extrusionFactor = 1.0 |
| | Extrusion multiply factor. More...
|
| |
| static int32_t | maxDeltaPositionSteps |
| |
| static int32_t | currentNonlinearPositionSteps [E_TOWER_ARRAY] |
| |
| static floatLong | deltaDiagonalStepsSquaredA |
| |
| static floatLong | deltaDiagonalStepsSquaredB |
| |
| static floatLong | deltaDiagonalStepsSquaredC |
| |
| static float | deltaMaxRadiusSquared |
| |
| static int32_t | deltaFloorSafetyMarginSteps |
| |
| static int32_t | deltaAPosXSteps |
| |
| static int32_t | deltaAPosYSteps |
| |
| static int32_t | deltaBPosXSteps |
| |
| static int32_t | deltaBPosYSteps |
| |
| static int32_t | deltaCPosXSteps |
| |
| static int32_t | deltaCPosYSteps |
| |
| static int32_t | realDeltaPositionSteps [TOWER_ARRAY] |
| |
| static int16_t | travelMovesPerSecond |
| |
| static int16_t | printMovesPerSecond |
| |
| static float | radius0 |
| |
| static int32_t | xMinStepsAdj |
| |
| static int32_t | yMinStepsAdj |
| |
| static int32_t | zMinStepsAdj |
| |
| static int32_t | xMaxStepsAdj |
| |
| static int32_t | yMaxStepsAdj |
| |
| static int32_t | zMaxStepsAdj |
| |
| static int32_t | zCorrectionStepsIncluded = 0 |
| |
| static int32_t | stepsRemainingAtZHit |
| |
| static int32_t | stepsRemainingAtXHit |
| |
| static int32_t | stepsRemainingAtYHit |
| |
| static int32_t | levelingP1 [3] |
| |
| static int32_t | levelingP2 [3] |
| |
| static int32_t | levelingP3 [3] |
| |
| static float | autolevelTransformation [9] |
| | Transformation matrix. More...
|
| |
| static float | thermoMinTemp |
| |
| static float | thermoMaxTemp |
| |
| static bool | sledParked |
| |
| static int16_t | zBabystepsMissing |
| |
| static int16_t | zBabysteps |
| |
| static int32_t | xMaxSteps |
| | For software endstops, limit of move in positive direction. More...
|
| |
| static int32_t | yMaxSteps |
| | For software endstops, limit of move in positive direction. More...
|
| |
| static int32_t | zMaxSteps |
| | For software endstops, limit of move in positive direction. More...
|
| |
| static int32_t | xMinSteps |
| | For software endstops, limit of move in negative direction. More...
|
| |
| static int32_t | yMinSteps |
| | For software endstops, limit of move in negative direction. More...
|
| |
| static int32_t | zMinSteps |
| | For software endstops, limit of move in negative direction. More...
|
| |
| static float | xLength |
| |
| static float | xMin |
| |
| static float | yLength |
| |
| static float | yMin |
| |
| static float | zLength |
| |
| static float | zMin |
| |
| static float | feedrate |
| | Last requested feedrate. More...
|
| |
| static int | feedrateMultiply |
| | Multiplier for feedrate in percent (factor 1 = 100) More...
|
| |
| static unsigned int | extrudeMultiply |
| | Flow multiplier in percent (factor 1 = 100) More...
|
| |
| static float | maxJerk |
| | Maximum allowed jerk in mm/s. More...
|
| |
| static uint8_t | interruptEvent = 0 |
| | Event generated in interrupts that should/could be handled in main thread. More...
|
| |
| static float | maxZJerk |
| | Maximum allowed jerk in z direction in mm/s. More...
|
| |
| static float | offsetX |
| | X-offset for different tool positions. More...
|
| |
| static float | offsetY |
| | Y-offset for different tool positions. More...
|
| |
| static float | offsetZ |
| | Z-offset for different tool positions. More...
|
| |
| static float | offsetZ2 = 0 |
| | Z-offset without rotation correction. Required for z probe corrections. More...
|
| |
| static speed_t | vMaxReached |
| | Maximum reached speed. More...
|
| |
| static uint32_t | msecondsPrinting |
| | Milliseconds of printing time (means time with heated extruder) More...
|
| |
| static float | filamentPrinted |
| | mm of filament printed since counting started More...
|
| |
| static float | backlashX |
| |
| static float | backlashY |
| |
| static float | backlashZ |
| |
| static uint8_t | backlashDir |
| |
| static fast8_t | multiZHomeFlags |
| |
| static float | memoryX = IGNORE_COORDINATE |
| |
| static float | memoryY = IGNORE_COORDINATE |
| |
| static float | memoryZ = IGNORE_COORDINATE |
| |
| static float | memoryE = IGNORE_COORDINATE |
| |
| static float | memoryF = -1 |
| |
| static int8_t | motorX |
| |
| static int8_t | motorYorZ |
| |
| static int | currentLayer = 0 |
| |
| static int | maxLayer = -1 |
| |
| static char | printName [21] = "" |
| |
| static float | progress = 0 |
| |
| static fast8_t | wizardStackPos |
| |
| static wizardVar | wizardStack [WIZARD_STACK_SIZE] |
| |
| static Distortion | distortion |
| |
The Printer class is the main class for the control of the 3d printer. Here all movement related key variables are stored like positions, accelerations.
Coordinates
The firmware works with 4 different coordinate systems and understanding the dependencies between them is crucial to a good understanding on how positions are handled.
Real world floating coordinates (RWC)
These coordinates are the real floating positions with any offsets subtracted, which might be set with G92. This is used to show coordinates or for computations based on real positions. Any correction coming from rotation or distortion is not included in these coordinates. currentPosition and lastCmdPos use this coordinate system.
When these coordinates need to be used for computation, the value of offsetX, offsetY and offsetZ is always added. These are the offsets of the currently active tool to virtual tool center (normally first extruder).
Rotated floating coordinates (ROTC)
If auto leveling is active, printing to the official coordinates is not possible. We have to assume that the bed is somehow rotated against the Cartesian mechanics from the printer. Applying transformToPrinter to the real world coordinates, rotates them around the origin to be equal to the rotated bed. transformFromPrinter would apply the opposite transformation.
Cartesian motor position coordinates (CMC)
The position of motors is stored as steps from 0. The reason for this is that it is crucial that no rounding errors ever cause addition of any steps. These positions are simply computed by multiplying the ROTC coordinates with the axisStepsPerMM.
If distortion correction is enabled, there is an additional factor for the z position that gets added: zCorrectionStepsIncluded This value is recalculated by every move added to reflect the distortion at any given xyz position.
Nonlinear motor position coordinates (NMC)
In case of a nonlinear mechanic like a delta printer, the CMC does not define the motor positions. An additional transformation converts the CMC coordinates into NMC.
Transformations from RWC to CMC
Given:
- Target position for tool: x_rwc, y_rwc, z_rwc
- Tool offsets: offsetX, offsetY, offsetZ
- Offset from bed leveling: offsetZ2
Step 1: Convert to ROTC
transformToPrinter(x_rwc + Printer::offsetX, y_rwc + Printer::offsetY, z_rwc + Printer::offsetZ, x_rotc, y_rotc, z_rotc);
z_rotc += offsetZ2
Step 2: Compute CMC
x_cmc = static_cast<int32_t>(floor(x_rotc * axisStepsPerMM[X_AXIS] + 0.5f));
y_cmc = static_cast<int32_t>(floor(y_rotc * axisStepsPerMM[Y_AXIS] + 0.5f));
z_cmc = static_cast<int32_t>(floor(z_rotc * axisStepsPerMM[Z_AXIS] + 0.5f));
Transformation from CMC to RWC
Note: zCorrectionStepsIncluded comes from distortion correction and gets set when a move is queued by the queuing function. Therefore it is not visible in the inverse transformation above. When transforming back, consider if the value was set or not!
Step 1: Convert to ROTC
x_rotc = static_cast<float>(x_cmc) * invAxisStepsPerMM[X_AXIS];
y_rotc = static_cast<float>(y_cmc) * invAxisStepsPerMM[Y_AXIS];
#if NONLINEAR_SYSTEM
z_rotc = static_cast<float>(z_cmc * invAxisStepsPerMM[Z_AXIS] - offsetZ2;
#else
z_rotc = static_cast<float>(z_cmc - zCorrectionStepsIncluded) * invAxisStepsPerMM[Z_AXIS] - offsetZ2;
#endif
Step 2: Convert to RWC
transformFromPrinter(x_rotc, y_rotc, z_rotc,x_rwc, y_rwc, z_rwc);
x_rwc -= Printer::offsetX; // Offset from active extruder or z probe
y_rwc -= Printer::offsetY;
z_rwc -= Printer::offsetZ;
| void Printer::homeZAxis |
( |
| ) |
|
|
static |
homes z axis.
Homing z axis is the most complicated homing part as it needs to correct for several parameters depending on rotation correction, distortion correction, position, homing direction, sensor type and bed coating. Because we get lots of support questions from "wrong" behavior due to misunderstandings of all these dependencies, I will try to describe the function as detailed as possible.
Step 1: Test if homing is possible at all
Test if homing in Z_HOME_DIR has a matching hardware endstop. If not, no z homing is possible at all.
Step 2: Activate z-probe if required
If homing to z min using a z-probe, activate the probe. Requires a position where this is possible, since probe offset could prevent the move. Hence in this case x and y must be homed first and a z homing position given and reached before calling this function.
Step 3: Fast homing to sensor
A move of 2 * z_length is send to printer. The move will stop when the endstop triggers.
Step 4: Untrigger sensor
Move in opposite direction ENDSTOP_Z_BACK_MOVE mm to disable the endstop signal safely.
Step 5: Retest endstop slowly
For best precision we rerun step 3 with 1/ENDSTOP_Z_RETEST_REDUCTION_FACTOR factor for speed. This should give a very accurate trigge rposition.
Step 6: Deactivate z-probe if it was activated in step 2
Step 7: Correct Z position
zCorrection sums up several influences:
- -axisStepsPerMM[Z_AXIS] * EEPROM::zProbeHeight() to compensate for z-prove trigger offset if probe was used.
- -axisStepsPerMM[Z_AXIS] * ENDSTOP_Z_BACK_ON_HOME * Z_HOME_DIR to add wanted extra distance ENDSTOP_Z_BACK_ON_HOME.
- axisStepsPerMM[Z_AXIS] * zBedOffset to correct for bed coating if correction mode Z_PROBE_Z_OFFSET_MODE == 0 and z min homing. and moves the z axis up that distance.
Step 8: Set position in CMC
For z min homing set currentPositionSteps[Z_AXIS] to zMinSteps. For z max homing set it to zMaxSteps - bed coating.
Set z offset according to selected tool z offset, if extruder is not sensor.
If distortion correction is enabled, set zCorrectionStepsIncluded and add value to currentPositionSteps.
#step 9: Compute RWC and correct rotation influence
Compute real position from position in steps. If rotation is on we did measure with a z-probe, this result is wrong and we need to correct by the z change between origin and current position.
currentPositionSteps[Z_AXIS] -= (axisStepsPerMM[Z_AXIS] * currentPosition[Z_AXIS] - zMinSteps);
currentPosition[Z_AXIS] = zMin;
Step 10: Update NMC for nonlinear systems
Step 11: Set babysteps to 0